package com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyActivity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ListView;

import com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyAdapter.EvaluateActivityAdapter;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.BuyACarFragmentModel;
import com.diudiutechnology.www.yadiudiu.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/8/30.
 * 评估明细
 */

public class EvaluateActivity extends Activity implements View.OnClickListener {
    @Bind(R.id.retur)
    LinearLayout retur;

    @Bind(R.id.listview)
    ListView listview;
    List<BuyACarFragmentModel> buycarlist;
    EvaluateActivityAdapter adapter;

    Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_evaluate);
        ButterKnife.bind(this);
        context=this;
        initView();
    }

    private void initView() {
        retur.setOnClickListener(this);

        adapter = new EvaluateActivityAdapter(context);
        listview.setAdapter(adapter);
        initData();

    }
    private void initData() {
        buycarlist = new ArrayList<>();
        BuyACarFragmentModel model = new BuyACarFragmentModel();
        model.setName("只是想改个名字");
        buycarlist.add(model);
        model = new BuyACarFragmentModel();
        model.setName("只是想改个名字");
        buycarlist.add(model);
        adapter.addItem(buycarlist);
    }
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.retur:
                finish();
                break;

        }
    }
}

